<script>
    function exprot(){
        alertify.confirm("确定要导出站点数据吗?", function (i) {
            if (i) {
                location.href = "__URL__/export";
            } else {
                alertify.error("取消操作！");
            }
        }, "mcit_default");
    }
</script>
 <import type='css' file="css.datatable.jquery-dataTables" />
<import type='css' file="css.site" />
<div class="site">
      <div class="location">
         <div class="bread">
                <img src="/Public/img/u318.png" widtd="16px" height="17px" />
                <div>当前位置：<a href="">站点管理</a> 》站点列表</div>
                <div class="cb"></div>
         </div>
  </div>
  <div class="add_export">
    <input type="button" id="export" value="数据导出" /><input type="button" id="add_site" value="添加站点" />
  </div>
    <div class="cb"></div>
    <div class="site_content">
        
        <div class="tab_select" id="tab_select">
            <div class="realtime selected"><input type="hidden" value="1" /><img src="/Public/img/u292.png" widtd="25px" height="25px" /><div>实时站点</div></div>
            <div class="third noselected"><input type="hidden" value="2" /><img src="/Public/img/u292.png" widtd="25px" height="25px" /><div>第三方站点</div></div>
        </div>

        <div class="search">
            <img src="/Public/img/map_maker_5.png" width="17px" height="20px" class="location_img"><span>所在地</span>
               <select id="seachprov" name="seachprov" onChange="changeComplexProvince(this.value, sub_array, 'seachcity', 'seachdistrict');"></select>&nbsp;&nbsp;
<select id="seachcity" name="homecity" onChange="changeCity(this.value,'seachdistrict','seachdistrict');"></select>&nbsp;&nbsp;
<span id="seachdistrict_div"><select id="seachdistrict" name="seachdistrict"></select></span>

                <!-- <input type="text" class="search_input_name" name="search_input_name" placeholder="按照站点名称进行搜索" />
                <input type="button"  value="搜索" class="btn_search" onClick="showAreaID()"/> -->
       </div>

       <div class="realtime_content">
        <table width="100%" border="0" id="realtime_table_id"  class="display" cellspacing="1">
           <thead>
               
              <tr>
                <td><input type="checkbox" id="realtime_all" /></td>
                <td>站点ID</td>
                <td>名称</td>
                <td>所在地</td>
                <td>
                    <select name="site_all">
                        <option value="1">全部</option>
                        <option value="2">快充</option>
                        <option value="3">慢充</option>
                    </select>
                 </td>
                <td>
                    <select name="site_plan">
                        <option value="1">预约</option>
                        <option value="2">支持</option>
                        <option value="3">不支持</option>
                    </select>
                </td>
                <td>
                <select name="site_state">
                        <option value="1">当前状态</option>
                        <option value="2">运营中</option>
                        <option value="3">规划中</option>
                        <option value="4">建设中</option>
                    </select>
                </td>
                <td>电桩总数</td>
                <td>车位</td>
              </tr>
        </thead>
        <tbody>
            
              <tr>
              
                <td><input type="checkbox" class="realtime_box" value="01" /></td>
                <td>01</td>
                <td><a href="#">汇东大酒店站</a></td>
                <td>002823412</td>
                <td>快充</td>
                <td class="support">支持</td>
                <td class="operation">运营中</td>
                <td>4</td>
                <td>2</td>
              </tr>
              <a href="#">
              <tr>
                <td><input type="checkbox" class="realtime_box" value="01" /></td>
                <td>01</td>
                <td>汇东大酒店站</td>
                <td>002823412</td>
                <td>快充</td>
                <td class="support">支持</td>
                <td class="operation">运营中</td>
                <td>4</td>
                <td>2</td>
              </tr></a>
              <tr>
                <td><input type="checkbox" class="realtime_box" value="02" /></td>
                <td>02</td>
                <td>汇东大酒店站</td>
                <td>四川省自贡市自流井</td>
                <td>慢充</td>
                <td class="nosupport">不支持</td>
                <td class="plan">规划中</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
              </tr>
              <tr>
                <td><input type="checkbox" class="realtime_box" value="02" /></td>
                <td>02</td>
                <td>汇东大酒店站</td>
                <td>四川省自贡市自流井</td>
                <td>慢充</td>
                <td class="nosupport">不支持</td>
                <td class="plan">规划中</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
              </tr>
               <tr>
                <td><input type="checkbox" class="third_box" value="01" /></td>
                <td>01</td>
                <td>汇东大酒店站</td>
                <td>四川省自贡市自流井</td>
                <td>快充</td>
                <td class="support">支持</td>
                <td class="operation">运营中</td>
                <td>4</td>
                <td>2</td>
              </tr>
               <tr>
                <td><input type="checkbox" class="third_box" value="01" /></td>
                <td>01</td>
                <td>汇东大酒店站</td>
                <td>四川省自贡市自流井</td>
                <td>快充</td>
                <td class="support">支持</td>
                <td class="operation">运营中</td>
                <td>4</td>
                <td>2</td>
              </tr>
               <tr>
                <td><input type="checkbox" class="third_box" value="01" /></td>
                <td>01</td>
                <td>汇东大酒店站</td>
                <td>四川省自贡市自流井</td>
                <td>快充</td>
                <td class="support">支持</td>
                <td class="operation">运营中</td>
                <td>4</td>
                <td>2</td>
              </tr>
               <tr>
                <td><input type="checkbox" class="third_box" value="01" /></td>
                <td>01</td>
                <td>汇东大酒店站</td>
                <td>四川省自贡市自流井</td>
                <td>快充</td>
                <td class="support">支持</td>
                <td class="operation">运营中</td>
                <td>4</td>
                <td>2</td>
              </tr>
               <tr>
                <td><input type="checkbox" class="third_box" value="01" /></td>
                <td>01</td>
                <td>汇东大酒店站</td>
                <td>四川省自贡市自流井</td>
                <td>快充</td>
                <td class="support">支持</td>
                <td class="operation">运营中</td>
                <td>4</td>
                <td>2</td>
              </tr>
               <tr>
                <td><input type="checkbox" class="third_box" value="01" /></td>
                <td>01</td>
                <td>汇东大酒店站</td>
                <td>四川省自贡市自流井</td>
                <td>快充</td>
                <td class="support">支持</td>
                <td class="operation">运营中</td>
                <td>4</td>
                <td>2</td>
              </tr>
               <tr>
                <td><input type="checkbox" class="third_box" value="01" /></td>
                <td>01</td>
                <td>汇东大酒店站</td>
                <td>四川省自贡市自流井</td>
                <td>快充</td>
                <td class="support">支持</td>
                <td class="operation">运营中</td>
                <td>4</td>
                <td>2</td>
              </tr>
               <tr>
                <td><input type="checkbox" class="third_box" value="01" /></td>
                <td>01</td>
                <td>汇东大酒店站</td>
                <td>天赋</td>
                <td>快充</td>
                <td class="support">支持</td>
                <td class="operation">运营中</td>
                <td>4</td>
                <td>2</td>
              </tr>

               <tr>
                <td><input type="checkbox" class="third_box" value="01" /></td>
                <td>01</td>
                <td>汇东大酒店站</td>
                <td>香年</td>
                <td>快充</td>
                <td class="support">支持</td>
                <td class="operation">运营中</td>
                <td>4</td>
                <td>2</td>
              </tr>
               <tr>
                <td><input type="checkbox" class="third_box" value="01" /></td>
                <td>01</td>
                <td>汇东大酒店站</td>
                <td>四川省自贡市自流井</td>
                <td>快充</td>
                <td class="support">支持</td>
                <td class="operation">运营中</td>
                <td>4</td>
                <td>2</td>
              </tr>
               <tr>
                <td><input type="checkbox" class="third_box" value="01" /></td>
                <td>01</td>
                <td>汇东大酒店站</td>
                <td>四川省自贡市自流井</td>
                <td>快充</td>
                <td class="support">支持</td>
                <td class="operation">运营中</td>
                <td>4</td>
                <td>2</td>
              </tr>
               <tr>
                <td><input type="checkbox" class="third_box" value="01" /></td>
                <td>01</td>
                <td>汇东大酒店站</td>
                <td>四川省自贡市自流井</td>
                <td>快充</td>
                <td class="support">支持</td>
                <td class="operation">运营中</td>
                <td>4</td>
                <td>2</td>
              </tr>
               <tr>
                <td><input type="checkbox" class="third_box" value="01" /></td>
                <td>01</td>
                <td>汇东大酒店站</td>
                <td>四川省自贡市自流井</td>
                <td>快充</td>
                <td class="support">支持</td>
                <td class="operation">运营中</td>
                <td>4</td>
                <td>2</td>
              </tr>

              <tr>
                <td><input type="checkbox" class="realtime_box" value="03" /></td>
                <td>03</td>
                <td>汇东大酒店站</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td class="build">建设中</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
              </tr>
            </tbody>
           </table>
            <div class="operate">
                <input type="button" value="全选" class="realtime_all_select"  />
                <input type="button" value="全不选" class="realtime_all_noselect"  />
                <input type="button" value="反选" class="realtime_re_select"  />
                <input type="button" value="批量删除" class="realtime_all_delete"  />
            </div>
            <div class="realtime_pageview">
                <div id="realtime_page"></div>
            </div>
        </div>
        <!--第三方-->
          <div class="third_content">
            <table widtd="100%" border="0" id="example" cellspacing="1">
            <thead>
                
              <tr>
                <td><input type="checkbox" id="third_all" /></td>
                <td>站点ID</td>
                <td>名称</td>
                <td>所在地</td>
                <td>
                    <select>
                        <option value="1">全部</option>
                        <option value="2">快充</option>
                        <option value="3">慢充</option>
                    </select>
                 </td>
                <td>
                    <select>
                        <option value="1">预约</option>
                        <option value="2">支持</option>
                        <option value="3">不支持</option>
                    </select>
                </td>
                <td>
                <select>
                        <option value="1">当前状态</option>
                        <option value="2">运营中</option>
                        <option value="3">规划中</option>
                        <option value="4">建设中</option>
                    </select>
                </td>
                <td>电桩总数</td>
                <td>车位</td>
              </tr>
              </thead>
              <tbody>
              <tr>
                <td><input type="checkbox" class="third_box" value="01" /></td>
                <td>01</td>
                <td>汇东大酒店站</td>
                <td>四川省自贡市自流井</td>
                <td>快充</td>
                <td class="support">支持</td>
                <td class="operation">运营中</td>
                <td>4</td>
                <td>2</td>
              </tr>
               <tr>
                <td><input type="checkbox" class="third_box" value="01" /></td>
                <td>01</td>
                <td>汇东大酒店站</td>
                <td>四川省自贡市自流井</td>
                <td>快充</td>
                <td class="support">支持</td>
                <td class="operation">运营中</td>
                <td>4</td>
                <td>2</td>
              </tr>
               <tr>
                <td><input type="checkbox" class="third_box" value="01" /></td>
                <td>01</td>
                <td>汇东大酒店站</td>
                <td>四川省自贡市自流井</td>
                <td>快充</td>
                <td class="support">支持</td>
                <td class="operation">运营中</td>
                <td>4</td>
                <td>2</td>
              </tr>
               <tr>
                <td><input type="checkbox" class="third_box" value="01" /></td>
                <td>01</td>
                <td>汇东大酒店站</td>
                <td>四川省自贡市自流井</td>
                <td>快充</td>
                <td class="support">支持</td>
                <td class="operation">运营中</td>
                <td>4</td>
                <td>2</td>
              </tr>
               <tr>
                <td><input type="checkbox" class="third_box" value="01" /></td>
                <td>01</td>
                <td>汇东大酒店站</td>
                <td>四川省自贡市自流井</td>
                <td>快充</td>
                <td class="support">支持</td>
                <td class="operation">运营中</td>
                <td>4</td>
                <td>2</td>
              </tr>
               <tr>
                <td><input type="checkbox" class="third_box" value="01" /></td>
                <td>01</td>
                <td>汇东大酒店站</td>
                <td>四川省自贡市自流井</td>
                <td>快充</td>
                <td class="support">支持</td>
                <td class="operation">运营中</td>
                <td>4</td>
                <td>2</td>
              </tr>
              <tr>
                <td><input type="checkbox" class="third_box" value="02" /></td>
                <td>02</td>
                <td>汇东大酒店站</td>
                <td>四川省自贡市自流井</td>
                <td>慢充</td>
                <td class="nosupport">不支持</td>
                <td class="plan">规划中</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
              </tr>
              <tr>
                <td><input type="checkbox" class="third_box" value="03" /></td>
                <td>03</td>
                <td>汇东大酒店站</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td class="build">建设中</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
              </tr>
              <tr>
                <td><input type="checkbox" class="third_box" value="04" /></td>
                <td>04</td>
                <td>汇东大酒店站</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td class="build">建设中</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
              </tr>
              </tbody>
            </table>
            <div class="operate">
                <input type="button" value="全选" class="third_all_select"  />
                <input type="button" value="全不选" class="third_all_noselect"  />
                <input type="button" value="反选" class="third_re_select"  />
                <input type="button" value="批量删除" class="third_all_delete"  />
            </div>
            <div class="third_pageview">
                <div id="third_page"></div>
            </div>
        </div>
        
    </div>
</div>


  <!--添加站点容器div-->
    <div id="add_site_div">
        <div class="title">添加新站点</div>
        <div class="content">
            <div class="table">
                <div><span>站点名称*</span><input name="input_site_name" class="input_site_name" type="text" /></div>
                <div>
                    <span>站点坐标*</span><input type="text" />
                    <span class="city">所在城市*</span>
                    <select id="add_site_seachprov" name="add_site_seachprov" onChange="changeComplexProvince(this.value, sub_array, 'add_site_seachcity', 'add_site_seachdistrict');"></select>&nbsp;&nbsp;
<select id="add_site_seachcity" name="add_site_homecity" onChange="changeCity(this.value,'add_site_seachdistrict','add_site_seachdistrict');"></select>&nbsp;&nbsp;
<span id="add_site_seachdistrict_div"><select id="add_site_seachdistrict" name="add_site_seachdistrict"></select></span>
                 </div>
                <div><span>所在商圈/楼盘*</span><input type="text" /><span class="address_detail">详细地址*</span><input class="input_address_detail" type="text" /></div>
                <div><span>状态服务器*</span><input name="state_server" class="state_server" type="text" />
                    <span class="site_nature">场地性质*</span><select name="site_nature" class="site_nature">
                                            <option value="1">充电点</option>
                                            <option value="2">充电站</option>
                                        </select></div>
                <div></div>
                <div></div>
                <div></div>
                <div></div>
                <div></div>
                <div></div>
                <div></div>
                <div></div>
            </div>
        </div>
    </div>

<import file="js.jquery-1#11#0#min" />
<import file="js.datatable.jquery#dataTables" />
 <import file="js.layer.layer" />
<import file="js.laypage.laypage" />
<script>
 
 $(function(){
    
     $("#tab_select > div").click(function(){
            $(this).removeClass("noselected");
            $(this).addClass("selected");
            $(this).siblings().removeClass("selected");
            $(this).siblings().addClass("noselected");
        });
    $("#tab_select > .realtime").click(function(){
            $(".third_content").css("display","none");
            $(".realtime_content").css("display","block");
        });
    $("#tab_select > .third").click(function(){
      
            $(".third_content").css("display","block");
            $(".realtime_content").css("display","none");
        });
    //实时站点操作
       // $("#realtime_all").click(function(){
       //           if($(this).attr("checked")){
       //             $(".realtime_box").prop("checked",true);//全选
       //             }
       //             else{
       //             $(".realtime_box").removeAttr("checked");//取消全选
                    
       //             }
       //   });
     

        $(".realtime_all_select").click(function(){
           
            $(".realtime_box").prop("checked",true);//全选
          
            })
         $(".realtime_all_noselect").click(function(){
     
            $(".realtime_box").removeAttr("checked");//取消全选
  
          })
         
         $(".realtime_re_select").click(function(){
                $(".realtime_box").each(function() {
                    $(this).prop("checked",!$(this).prop("checked"));
                });
             }); 
            
        $(".realtime_all_delete").click(function(){
                    var str="";//需要删除的id，传入后台
                    $(".realtime_box").each(function() {
                        if($(this).prop("checked")){
                                str = str+$(this).val()+",";
                            }
                    });
                    if(str){
                       layer.confirm('你确定此次删除操作吗？注意！此站点下所有电桩都将删除，删除后将不可恢复。', {icon: 7}, function(index){
                            layer.close(index);
                            $.ajax({
                                type:"get",
                                url:'__URL__/del',
                                data:'id='+str,
                                success:function(data) {
                                    if(data==1){
                                        layer.msg('操作成功', {
                                            icon: 1,
                                            time: 2000 //2秒关闭（如果不配置，默认是3秒）
                                        }, function(){
                                             location.reload();
                                        });
                                    }else{
                                        layer.msg('删除失败', {icon: 5});
                                    }
                                }
                             });
                            });
                    }else{
                        layer.msg('您没有选择要删除的数据', {icon: 5});
                    }
                    
            }); 
    //datatables
     $("#realtime_table_id").DataTable({
            paging: true,
            searching: true,
             language: {
                "sProcessing": "处理中...",
                "sLengthMenu": " ",
                "sZeroRecords": "没有匹配结果",
                "sInfo":" ",
                "sInfoEmpty": "显示第 0 至 0 项结果，共 0 项",
                "sInfoFiltered": "(由 _MAX_ 项结果过滤)",
                "sInfoPostFix": "",
                "sSearch": "搜索:",
                "sUrl": "",
                "sEmptyTable": "表中数据为空",
                "sLoadingRecords": "载入中...",
                "sInfoThousands": ",",
                "oPaginate": {
                    "sFirst": "首页",
                    "sPrevious": "上页",
                    "sNext": "下页",
                    "sLast": "末页"
                },
                "oAria": {
                    "sSortAscending": ": 以升序排列此列",
                    "sSortDescending": ": 以降序排列此列"
                }
            }
        } );

     //添加站点
    $("#add_site").click(function(){
        layer.open({
            type: 1,
            area: ['700px', '600px'],
            title: false,
            closeBtn: false,
            shadeClose: true,
            skin: '#ffffff',
            content: $("#add_site_div")
        }); 
    });

 });

</script>
